export default function createLoginImgCodeSchema(codeName, codeId, serviceId) {
    return {
        type: 'group',
        label: false,
        required: true,
        name: 'input-group-code' || ('input-group-' + codeName),
        body:[
            {
                type: 'input-text',
                label: false,
                placeholder: '请输入验证码',
                required: true,
                name: codeName || 'code',
                id: codeId || 'code',
                maxLength: 6,
                validationErrors: {
                    isRequired: '请输入验证码'
                },
                addOn:{
                    type: 'icon',
                    icon: 'fa fa-shield',
                    position: 'left'
                },
                className: 'login-left-control'
            },
            {
                type: 'service',
                id: serviceId || 'service-img-code',
                name: serviceId || 'service-img-code',
                api: '${API_HOST}/base/captcha/image',
                interval: 180000,
                body: [
                {
                    type: 'image',
                    width: 120,
                    height: 40,
                    thumbMode: 'cover',
                    innerClassName: 'no-border',
                    src: '${base64}',
                    clickAction: {
                        target: serviceId || 'service-img-code',
                        actionType: 'reload'
                    },
                    //和文本框对齐，并吸附在文本框右侧
                    style:{
                        'margin-top': '-4px',
                        'margin-left': '-20px'
                    }
                }]
            }
        ]
    }
}